console.log('目录设置', catalogue)

// const location = router.options.history.location
const location = '' // HTML5 模式
// const location = catalogue // Hash 模式

const routes = [
  {
    path: `${location}/`,
    name: 'Home',
    title: '慕茹姬',
    component: () => myImport('views/home')
  },
  {
    path: `${location}/Brand`,
    name: 'Brand',
    title: '品牌故事',
    component: () => myImport('views/Brand')
  },
  {
    path: `${location}/Product`,
    name: 'Product',
    title: '产品列表',
    component: () => myImport('views/Product'),
    children: [
      {
        path: `Detail/:index`,
        name: 'pDetail',
        component: () => myImport('views/ProductDetail')
      }]
  },
  {
    path: `${location}/Info`,
    name: 'Info',
    title: '护肤资讯',
    component: () => myImport('views/Info'),
    children: [
      {
        path: 'Detail/:index',
        name: 'iDetail',
        component: () => myImport('views/InfoDetail')
      }]
  },
  {
    path: `${location}/Contact`,
    name: 'Contact',
    title: '联系我们',
    component: () => myImport('views/Contact')
  }
  /*
    {
      path: `${location}/component`,
      name: 'component',
      title: '异步组件',
      component: () => myImport('views/component')
    },
    {
      path: `${location}/store`,
      name: 'store',
      title: '状态管理',
      component: () => myImport('views/store')
    }
    */
]

const router = VueRouter.createRouter({
  history: VueRouter.createWebHashHistory(), // Hash 模式
  // history: VueRouter.createWebHistory(), // HTML5 模式
  routes
})
/*
let historyModes = 'Hash 模式'
if(router.options.history.base == ''){
  historyModes = 'HTML5 模式'
}
console.log(historyModes)
console.log('routes:',router.options.routes)
console.log('location:',router.options.history.location)
*/
export default router
